package com.didi.arius.gateway.rest.controller.es;

import com.didi.arius.gateway.common.metadata.QueryContext;
import com.didi.arius.gateway.core.es.http.action.RestCommonAction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import static org.elasticsearch.rest.RestRequest.Method.*;

@Controller
public class RestCommonController extends ESBaseController {

    @Autowired
    private RestCommonAction restCommonAction;

    public RestCommonController() {
        // pass
    }

    @Override
    protected void register() {
        controller.registerHandler(DELETE, "/_ccr/auto_follow/{name}", this);
        controller.registerHandler(DELETE, "/_cluster/voting_config_exclusions", this);
        controller.registerHandler(DELETE, "/_data_frame/transforms/{id}/", this);
        controller.registerHandler(DELETE, "/_dcdr/auto_replication/{name}", this);
        controller.registerHandler(DELETE, "/_dcdr/{index}/replication/delete", this);
        controller.registerHandler(DELETE, "/_enrich/policy/{name}", this);
        controller.registerHandler(DELETE, "/_ilm/policy/{name}", this);
        controller.registerHandler(DELETE, "/_ingest/pipeline/{id}", this);
        controller.registerHandler(DELETE, "/_license", this);
        controller.registerHandler(DELETE, "/_rollup/job/{id}", this);
        controller.registerHandler(DELETE, "/_scripts/{id}", this);
        controller.registerHandler(DELETE, "/_security/api_key", this);
        controller.registerHandler(DELETE, "/_security/oauth2/token", this);
        controller.registerHandler(DELETE, "/_security/privilege/{application}/{privilege}", this);
        controller.registerHandler(DELETE, "/_security/role/{name}", this);
        controller.registerHandler(DELETE, "/_security/role_mapping/{name}", this);
        controller.registerHandler(DELETE, "/_security/user/{username}", this);
        controller.registerHandler(DELETE, "/_slm/policy/{name}", this);
        controller.registerHandler(DELETE, "/_snapshot/{repository}", this);
        controller.registerHandler(DELETE, "/_snapshot/{repository}/{snapshot}", this);
        controller.registerHandler(DELETE, "/_template/{index}", this);
        controller.registerHandler(DELETE, "/_transform/{id}/", this);
        controller.registerHandler(DELETE, "/_watcher/watch/{id}", this);
        controller.registerHandler(DELETE, "/_xpack/license", this);
        controller.registerHandler(DELETE, "/_xpack/rollup/job/{id}/", this);
        controller.registerHandler(DELETE, "/_xpack/security/oauth2/token", this);
        controller.registerHandler(DELETE, "/_xpack/security/privilege/{application}/{privilege}", this);
        controller.registerHandler(DELETE, "/_xpack/security/role/{name}", this);
        controller.registerHandler(DELETE, "/_xpack/security/role_mapping/{name}", this);
        controller.registerHandler(DELETE, "/_xpack/security/user/{username}", this);
        controller.registerHandler(DELETE, "/_xpack/watcher/watch/{id}", this);
        controller.registerHandler(GET, "/_cache/clear", this);
        controller.registerHandler(GET, "/_cat", this);
        controller.registerHandler(GET, "/_cat/aliases", this);
        controller.registerHandler(GET, "/_cat/aliases/{alias}", this);
        controller.registerHandler(GET, "/_cat/allocation", this);
        controller.registerHandler(GET, "/_cat/allocation/{nodes}", this);
        controller.registerHandler(GET, "/_cat/count", this);
        controller.registerHandler(GET, "/_cat/count/{index}", this);
        controller.registerHandler(GET, "/_cat/example", this);
        controller.registerHandler(GET, "/_cat/fielddata", this);
        controller.registerHandler(GET, "/_cat/fielddata/{fields}", this);
        controller.registerHandler(GET, "/_cat/group/factor", this);
        controller.registerHandler(GET, "/_cat/group/factor/{group}", this);
        controller.registerHandler(GET, "/_cat/health", this);
        controller.registerHandler(GET, "/_cat/master", this);
        controller.registerHandler(GET, "/_cat/node/group/factor/{node}", this);
        controller.registerHandler(GET, "/_cat/node/group/factor/{node}/{group}", this);
        controller.registerHandler(GET, "/_cat/nodeattrs", this);
        controller.registerHandler(GET, "/_cat/nodes", this);
        controller.registerHandler(GET, "/_cat/pending_tasks", this);
        controller.registerHandler(GET, "/_cat/plugins", this);
        controller.registerHandler(GET, "/_cat/recovery", this);
        controller.registerHandler(GET, "/_cat/recovery/{index}", this);
        controller.registerHandler(GET, "/_cat/repositories", this);
        controller.registerHandler(GET, "/_cat/segments", this);
        controller.registerHandler(GET, "/_cat/segments/{index}", this);
        controller.registerHandler(GET, "/_cat/shards", this);
        controller.registerHandler(GET, "/_cat/shards/{index}", this);
        controller.registerHandler(GET, "/_cat/snapshots", this);
        controller.registerHandler(GET, "/_cat/snapshots/{repository}", this);
        controller.registerHandler(GET, "/_cat/tasks", this);
        controller.registerHandler(GET, "/_cat/templates", this);
        controller.registerHandler(GET, "/_cat/templates/{name}", this);
        controller.registerHandler(GET, "/_cat/thread_pool", this);
        controller.registerHandler(GET, "/_cat/thread_pool/{thread_pool_patterns}", this);
        controller.registerHandler(GET, "/_ccr/auto_follow", this);
        controller.registerHandler(GET, "/_ccr/auto_follow/{name}", this);
        controller.registerHandler(GET, "/_ccr/stats", this);
        controller.registerHandler(GET, "/_cluster/allocation/explain", this);
        controller.registerHandler(GET, "/_cluster/nodes/hot_threads", this);
        controller.registerHandler(GET, "/_cluster/nodes/hotthreads", this);
        controller.registerHandler(GET, "/_cluster/nodes/{nodeId}/hot_threads", this);
        controller.registerHandler(GET, "/_cluster/nodes/{nodeId}/hotthreads", this);
        controller.registerHandler(GET, "/_cluster/pending_tasks", this);
        controller.registerHandler(GET, "/_cluster/settings", this);
        controller.registerHandler(GET, "/_cluster/state", this);
        controller.registerHandler(GET, "/_cluster/state/{metric}", this);
        controller.registerHandler(GET, "/_cluster/state/{metric}/{indices}", this);
        controller.registerHandler(GET, "/_cluster/stats", this);
        controller.registerHandler(GET, "/_cluster/stats/nodes/{nodeId}", this);
        controller.registerHandler(GET, "/_data_frame/transforms/", this);
        controller.registerHandler(GET, "/_data_frame/transforms/_stats", this);
        controller.registerHandler(GET, "/_data_frame/transforms/{id}/", this);
        controller.registerHandler(GET, "/_data_frame/transforms/{id}/_stats", this);
        controller.registerHandler(GET, "/_dcdr/auto_replication", this);
        controller.registerHandler(GET, "/_dcdr/auto_replication/{name}", this);
        controller.registerHandler(GET, "/_dcdr/replication", this);
        controller.registerHandler(GET, "/_dcdr/stats", this);
        controller.registerHandler(GET, "/_dcdr/{index}/replication", this);
        controller.registerHandler(GET, "/_dcdr/{index}/stats", this);
        controller.registerHandler(GET, "/_dcdr/{index}/{shard}/fetch_shard_info", this);
        controller.registerHandler(GET, "/_die_with_dignity", this);
        controller.registerHandler(GET, "/_enrich/_stats", this);
        controller.registerHandler(GET, "/_enrich/policy", this);
        controller.registerHandler(GET, "/_enrich/policy/{name}", this);
        controller.registerHandler(GET, "/_dummy", this);
        controller.registerHandler(GET, "/_field_caps", this);
        controller.registerHandler(GET, "/_flush", this);
        controller.registerHandler(GET, "/_flush/synced", this);
        controller.registerHandler(GET, "/_ilm/policy", this);
        controller.registerHandler(GET, "/_ilm/policy/{name}", this);
        controller.registerHandler(GET, "/_ilm/status", this);
        controller.registerHandler(GET, "/_ingest/pipeline", this);
        controller.registerHandler(GET, "/_ingest/pipeline/_simulate", this);
        controller.registerHandler(GET, "/_ingest/pipeline/{id}", this);
        controller.registerHandler(GET, "/_ingest/pipeline/{id}/_simulate", this);
        controller.registerHandler(GET, "/_ingest/processor/grok", this);
        controller.registerHandler(GET, "/_license", this);
        controller.registerHandler(GET, "/_license/basic_status", this);
        controller.registerHandler(GET, "/_license/trial_status", this);
        controller.registerHandler(GET, "/_migration/deprecations", this);
        controller.registerHandler(GET, "/_mtermvectors", this);
        controller.registerHandler(GET, "/_nodes/hot_threads", this);
        controller.registerHandler(GET, "/_nodes/hotthreads", this);
        controller.registerHandler(GET, "/_nodes/stats", this);
        controller.registerHandler(GET, "/_nodes/stats/{metric}", this);
        controller.registerHandler(GET, "/_nodes/stats/{metric}/{index_metric}", this);
        controller.registerHandler(GET, "/_nodes/usage", this);
        controller.registerHandler(GET, "/_nodes/usage/{metric}", this);
        controller.registerHandler(GET, "/_nodes/{nodeId}/hot_threads", this);
        controller.registerHandler(GET, "/_nodes/{nodeId}/hotthreads", this);
        controller.registerHandler(GET, "/_nodes/{nodeId}/stats", this);
        controller.registerHandler(GET, "/_nodes/{nodeId}/stats/{metric}", this);
        controller.registerHandler(GET, "/_nodes/{nodeId}/stats/{metric}/{index_metric}", this);
        controller.registerHandler(GET, "/_nodes/{nodeId}/usage", this);
        controller.registerHandler(GET, "/_nodes/{nodeId}/usage/{metric}", this);
        controller.registerHandler(GET, "/_rank_eval", this);
        controller.registerHandler(GET, "/_noop_search", this);
        controller.registerHandler(GET, "/_protected", this);
        controller.registerHandler(GET, "/_recovery", this);
        controller.registerHandler(GET, "/_render/template", this);
        controller.registerHandler(GET, "/_render/template/{id}", this);
        controller.registerHandler(GET, "/_rollup/data/{id}", this);
        controller.registerHandler(GET, "/_rollup/job/{id}", this);
        controller.registerHandler(GET, "/_script_context", this);
        controller.registerHandler(GET, "/_script_language", this);
        controller.registerHandler(GET, "/_scripts/painless/_context", this);
        controller.registerHandler(GET, "/_scripts/painless/_execute", this);
        controller.registerHandler(GET, "/_scripts/{id}", this);
        controller.registerHandler(GET, "/_search_shards", this);
        controller.registerHandler(GET, "/_security/_authenticate", this);
        controller.registerHandler(GET, "/_security/api_key", this);
        controller.registerHandler(GET, "/_security/privilege/", this);
        controller.registerHandler(GET, "/_security/privilege/_builtin", this);
        controller.registerHandler(GET, "/_security/privilege/{application}", this);
        controller.registerHandler(GET, "/_security/privilege/{application}/{privilege}", this);
        controller.registerHandler(GET, "/_security/role/", this);
        controller.registerHandler(GET, "/_security/role/{name}", this);
        controller.registerHandler(GET, "/_security/role_mapping/", this);
        controller.registerHandler(GET, "/_security/role_mapping/{name}", this);
        controller.registerHandler(GET, "/_security/user/", this);
        controller.registerHandler(GET, "/_security/user/_has_privileges", this);
        controller.registerHandler(GET, "/_security/user/_privileges", this);
        controller.registerHandler(GET, "/_security/user/{username}", this);
        controller.registerHandler(GET, "/_security/user/{username}/_has_privileges", this);
        controller.registerHandler(GET, "/_segments", this);
        controller.registerHandler(GET, "/_shard_stores", this);
        controller.registerHandler(GET, "/_slm/policy", this);
        controller.registerHandler(GET, "/_slm/policy/{name}", this);
        controller.registerHandler(GET, "/_slm/stats", this);
        controller.registerHandler(GET, "/_slm/status", this);
        controller.registerHandler(GET, "/_snapshot", this);
        controller.registerHandler(GET, "/_snapshot/_status", this);
        controller.registerHandler(GET, "/_snapshot/{repository}", this);
        controller.registerHandler(GET, "/_snapshot/{repository}/_status", this);
        controller.registerHandler(GET, "/_snapshot/{repository}/{snapshot}", this);
        controller.registerHandler(GET, "/_snapshot/{repository}/{snapshot}/_status", this);
        controller.registerHandler(GET, "/_ssl/certificates", this);
        controller.registerHandler(GET, "/_stats", this);
        controller.registerHandler(GET, "/_stats/{metric}", this);
        controller.registerHandler(GET, "/_tasks", this);
        controller.registerHandler(GET, "/_tasks/{task_id}", this);
        controller.registerHandler(GET, "/_template", this);
        controller.registerHandler(GET, "/_template/{index}", this);
        controller.registerHandler(GET, "/_transform/", this);
        controller.registerHandler(GET, "/_transform/_stats", this);
        controller.registerHandler(GET, "/_transform/{id}/", this);
        controller.registerHandler(GET, "/_transform/{id}/_stats", this);
        controller.registerHandler(GET, "/_upgrade", this);
        controller.registerHandler(GET, "/_validate/query", this);
        controller.registerHandler(GET, "/_watcher/stats", this);
        controller.registerHandler(GET, "/_watcher/stats/{metric}", this);
        controller.registerHandler(GET, "/_watcher/watch/{id}", this);
        controller.registerHandler(GET, "/_xpack", this);
        controller.registerHandler(GET, "/_xpack/license", this);
        controller.registerHandler(GET, "/_xpack/license/basic_status", this);
        controller.registerHandler(GET, "/_xpack/license/trial_status", this);
        controller.registerHandler(GET, "/_xpack/migration/assistance", this);
        controller.registerHandler(GET, "/_xpack/migration/assistance/{index}", this);
        controller.registerHandler(GET, "/_xpack/migration/deprecations", this);
        controller.registerHandler(GET, "/_xpack/rollup/data/{id}/", this);
        controller.registerHandler(GET, "/_xpack/rollup/job/{id}/", this);
        controller.registerHandler(GET, "/_xpack/security/_authenticate", this);
        controller.registerHandler(GET, "/_xpack/security/privilege/", this);
        controller.registerHandler(GET, "/_xpack/security/privilege/{application}", this);
        controller.registerHandler(GET, "/_xpack/security/privilege/{application}/{privilege}", this);
        controller.registerHandler(GET, "/_xpack/security/role/", this);
        controller.registerHandler(GET, "/_xpack/security/role/{name}", this);
        controller.registerHandler(GET, "/_xpack/security/role_mapping/", this);
        controller.registerHandler(GET, "/_xpack/security/role_mapping/{name}", this);
        controller.registerHandler(GET, "/_xpack/security/user/", this);
        controller.registerHandler(GET, "/_xpack/security/user/_has_privileges", this);
        controller.registerHandler(GET, "/_xpack/security/user/_privileges", this);
        controller.registerHandler(GET, "/_xpack/security/user/{username}", this);
        controller.registerHandler(GET, "/_xpack/security/user/{username}/_has_privileges", this);
        controller.registerHandler(GET, "/_xpack/sql", this);
        controller.registerHandler(GET, "/_xpack/sql/stats", this);
        controller.registerHandler(GET, "/_xpack/sql/translate", this);
        controller.registerHandler(GET, "/_xpack/ssl/certificates", this);
        controller.registerHandler(GET, "/_xpack/usage", this);
        controller.registerHandler(GET, "/_xpack/watcher/stats", this);
        controller.registerHandler(GET, "/_xpack/watcher/stats/{metric}", this);
        controller.registerHandler(GET, "/_xpack/watcher/watch/{id}", this);
        controller.registerHandler(GET, "/_all/_rollup/data", this);
        controller.registerHandler(GET, "/{index}", this);
        controller.registerHandler(GET, "/{index}/{type}", this);
        controller.registerHandler(GET, "/{index}/_cache/clear", this);
        controller.registerHandler(GET, "/{index}/_ccr/info", this);
        controller.registerHandler(GET, "/{index}/_ccr/stats", this);
        controller.registerHandler(GET, "/{index}/_explain/{id}", this);
        controller.registerHandler(GET, "/{index}/_field_caps", this);
        controller.registerHandler(GET, "/{index}/_flush", this);
        controller.registerHandler(GET, "/{index}/_flush/synced", this);
        controller.registerHandler(GET, "/{index}/_graph/explore", this);
        controller.registerHandler(GET, "/{index}/_ilm/explain", this);
        controller.registerHandler(GET, "/{index}/_migration/deprecations", this);
        controller.registerHandler(GET, "/{index}/_mtermvectors", this);
        controller.registerHandler(GET, "/{index}/_rank_eval", this);
        controller.registerHandler(GET, "/{index}/_noop_search", this);
        controller.registerHandler(GET, "/{index}/_recovery", this);
        controller.registerHandler(GET, "/{index}/_reload_search_analyzers", this);
        controller.registerHandler(GET, "/{index}/_rollup/data", this);
        controller.registerHandler(GET, "/{index}/_search_shards", this);
        controller.registerHandler(GET, "/{index}/_segments", this);
        controller.registerHandler(GET, "/{index}/_shard_stores", this);
        controller.registerHandler(GET, "/{index}/_stats", this);
        controller.registerHandler(GET, "/{index}/_stats/{metric}", this);
        controller.registerHandler(GET, "/{index}/_termvectors", this);
        controller.registerHandler(GET, "/{index}/_termvectors/{id}", this);
        controller.registerHandler(GET, "/{index}/_upgrade", this);
        controller.registerHandler(GET, "/{index}/_validate/query", this);
        controller.registerHandler(GET, "/{index}/_xpack/graph/_explore", this);
        controller.registerHandler(GET, "/{index}/_xpack/migration/deprecations", this);
        controller.registerHandler(GET, "/{index}/_xpack/rollup/data", this);
        controller.registerHandler(GET, "/{index}/{type}/_graph/explore", this);
        controller.registerHandler(GET, "/{index}/{type}/_mtermvectors", this);
        controller.registerHandler(GET, "/{index}/{type}/_noop_search", this);
        controller.registerHandler(GET, "/{index}/{type}/_termvector", this);
        controller.registerHandler(GET, "/{index}/{type}/_termvectors", this);
        controller.registerHandler(GET, "/{index}/{type}/_validate/query", this);
        controller.registerHandler(GET, "/{index}/{type}/_xpack/graph/_explore", this);
        controller.registerHandler(GET, "/{index}/{type}/{id}/_explain", this);
        controller.registerHandler(GET, "/{index}/{type}/{id}/_termvector", this);
        controller.registerHandler(GET, "/{index}/{type}/{id}/_termvectors", this);
        controller.registerHandler(GET, "_remote/info", this);
        controller.registerHandler(GET, "_rollup_search", this);
        controller.registerHandler(GET, "{index}/_rollup_search", this);
        controller.registerHandler(HEAD, "/_template/{index}", this);
        controller.registerHandler(HEAD, "/_xpack", this);
        controller.registerHandler(HEAD, "/{index}", this);
        controller.registerHandler(POST, "/_cache/clear", this);
        controller.registerHandler(POST, "/_cat/example", this);
        controller.registerHandler(POST, "/_ccr/auto_follow/{name}/pause", this);
        controller.registerHandler(POST, "/_ccr/auto_follow/{name}/resume", this);
        controller.registerHandler(POST, "/_close", this);
        controller.registerHandler(POST, "/_cluster/allocation/explain", this);
        controller.registerHandler(POST, "/_cluster/reroute", this);
        controller.registerHandler(POST, "/_cluster/voting_config_exclusions/{node_name}", this);
        controller.registerHandler(POST, "/_data_frame/transforms/_preview", this);
        controller.registerHandler(POST, "/_data_frame/transforms/{id}/_start", this);
        controller.registerHandler(POST, "/_data_frame/transforms/{id}/_stop", this);
        controller.registerHandler(POST, "/_data_frame/transforms/{id}/_update", this);
        controller.registerHandler(POST, "/_dcdr/{index}/recover", this);
        controller.registerHandler(POST, "/_dcdr/{index}/recover/{shard}", this);
        controller.registerHandler(POST, "/_dcdr/{index}/replication/pause", this);
        controller.registerHandler(POST, "/_dcdr/{index}/replication/resume", this);
        controller.registerHandler(POST, "/_delete_by_query/{taskId}/_rethrottle", this);
        controller.registerHandler(POST, "/_enrich/policy/{name}/_execute", this);
        controller.registerHandler(POST, "/_field_caps", this);
        controller.registerHandler(POST, "/_flush", this);
        controller.registerHandler(POST, "/_flush/synced", this);
        controller.registerHandler(POST, "/_forcemerge", this);
        controller.registerHandler(POST, "/_ilm/move/{name}", this);
        controller.registerHandler(POST, "/_ilm/start", this);
        controller.registerHandler(POST, "/_ilm/stop", this);
        controller.registerHandler(POST, "/_ingest/pipeline/_simulate", this);
        controller.registerHandler(POST, "/_ingest/pipeline/{id}/_simulate", this);
        controller.registerHandler(POST, "/_license", this);
        controller.registerHandler(POST, "/_license/start_basic", this);
        controller.registerHandler(POST, "/_license/start_trial", this);
        controller.registerHandler(POST, "/_monitoring/bulk", this);
        controller.registerHandler(POST, "/_mtermvectors", this);
        controller.registerHandler(POST, "/_nodes/reload_secure_settings", this);
        controller.registerHandler(POST, "/_nodes/{nodeId}/reload_secure_settings", this);
        controller.registerHandler(POST, "/_noop_bulk", this);
        controller.registerHandler(POST, "/_noop_search", this);
        controller.registerHandler(POST, "/_open", this);
        controller.registerHandler(POST, "/_rank_eval", this);
        controller.registerHandler(POST, "/_reindex", this);
        controller.registerHandler(POST, "/_reindex/{taskId}/_rethrottle", this);
        controller.registerHandler(POST, "/_render/template", this);
        controller.registerHandler(POST, "/_render/template/{id}", this);
        controller.registerHandler(POST, "/_rollup/job/{id}/_start", this);
        controller.registerHandler(POST, "/_rollup/job/{id}/_stop", this);
        controller.registerHandler(POST, "/_scripts/painless/_execute", this);
        controller.registerHandler(POST, "/_scripts/{id}", this);
        controller.registerHandler(POST, "/_scripts/{id}/{context}", this);
        controller.registerHandler(POST, "/_search_shards", this);
        controller.registerHandler(POST, "/_security/api_key", this);
        controller.registerHandler(POST, "/_security/delegate_pki", this);
        controller.registerHandler(POST, "/_security/oauth2/token", this);
        controller.registerHandler(POST, "/_security/oidc/authenticate", this);
        controller.registerHandler(POST, "/_security/oidc/logout", this);
        controller.registerHandler(POST, "/_security/oidc/prepare", this);
        controller.registerHandler(POST, "/_security/privilege/", this);
        controller.registerHandler(POST, "/_security/realm/{realms}/_clear_cache", this);
        controller.registerHandler(POST, "/_security/role/{name}", this);
        controller.registerHandler(POST, "/_security/role/{name}/_clear_cache", this);
        controller.registerHandler(POST, "/_security/role_mapping/{name}", this);
        controller.registerHandler(POST, "/_security/saml/authenticate", this);
        controller.registerHandler(POST, "/_security/saml/invalidate", this);
        controller.registerHandler(POST, "/_security/saml/logout", this);
        controller.registerHandler(POST, "/_security/saml/prepare", this);
        controller.registerHandler(POST, "/_security/user/_has_privileges", this);
        controller.registerHandler(POST, "/_security/user/_password", this);
        controller.registerHandler(POST, "/_security/user/{username}", this);
        controller.registerHandler(POST, "/_security/user/{username}/_disable", this);
        controller.registerHandler(POST, "/_security/user/{username}/_enable", this);
        controller.registerHandler(POST, "/_security/user/{username}/_has_privileges", this);
        controller.registerHandler(POST, "/_security/user/{username}/_password", this);
        controller.registerHandler(POST, "/_slm/_execute_retention", this);
        controller.registerHandler(POST, "/_slm/policy/{name}/_execute", this);
        controller.registerHandler(POST, "/_slm/start", this);
        controller.registerHandler(POST, "/_slm/stop", this);
        controller.registerHandler(POST, "/_snapshot/{repository}", this);
        controller.registerHandler(POST, "/_snapshot/{repository}/_cleanup", this);
        controller.registerHandler(POST, "/_snapshot/{repository}/_verify", this);
        controller.registerHandler(POST, "/_snapshot/{repository}/{snapshot}", this);
        controller.registerHandler(POST, "/_snapshot/{repository}/{snapshot}/_restore", this);
        controller.registerHandler(POST, "/_tasks/_cancel", this);
        controller.registerHandler(POST, "/_tasks/{task_id}/_cancel", this);
        controller.registerHandler(POST, "/_template/{index}", this);
        controller.registerHandler(POST, "/_transform/_preview", this);
        controller.registerHandler(POST, "/_transform/{id}/_start", this);
        controller.registerHandler(POST, "/_transform/{id}/_stop", this);
        controller.registerHandler(POST, "/_transform/{id}/_update", this);
        controller.registerHandler(POST, "/_update_by_query/{taskId}/_rethrottle", this);
        controller.registerHandler(POST, "/_upgrade", this);
        controller.registerHandler(POST, "/_validate/query", this);
        controller.registerHandler(POST, "/_watcher/_start", this);
        controller.registerHandler(POST, "/_watcher/_stop", this);
        controller.registerHandler(POST, "/_watcher/watch/_execute", this);
        controller.registerHandler(POST, "/_watcher/watch/{id}", this);
        controller.registerHandler(POST, "/_watcher/watch/{id}/_ack", this);
        controller.registerHandler(POST, "/_watcher/watch/{id}/_ack/{actions}", this);
        controller.registerHandler(POST, "/_watcher/watch/{id}/_activate", this);
        controller.registerHandler(POST, "/_watcher/watch/{id}/_deactivate", this);
        controller.registerHandler(POST, "/_watcher/watch/{id}/_execute", this);
        controller.registerHandler(POST, "/_xpack/license", this);
        controller.registerHandler(POST, "/_xpack/license/start_basic", this);
        controller.registerHandler(POST, "/_xpack/license/start_trial", this);
        controller.registerHandler(POST, "/_xpack/monitoring/_bulk", this);
        controller.registerHandler(POST, "/_xpack/rollup/job/{id}/_start", this);
        controller.registerHandler(POST, "/_xpack/rollup/job/{id}/_stop", this);
        controller.registerHandler(POST, "/_xpack/security/oauth2/token", this);
        controller.registerHandler(POST, "/_xpack/security/privilege/", this);
        controller.registerHandler(POST, "/_xpack/security/realm/{realms}/_clear_cache", this);
        controller.registerHandler(POST, "/_xpack/security/role/{name}", this);
        controller.registerHandler(POST, "/_xpack/security/role/{name}/_clear_cache", this);
        controller.registerHandler(POST, "/_xpack/security/role_mapping/{name}", this);
        controller.registerHandler(POST, "/_xpack/security/saml/authenticate", this);
        controller.registerHandler(POST, "/_xpack/security/saml/invalidate", this);
        controller.registerHandler(POST, "/_xpack/security/saml/logout", this);
        controller.registerHandler(POST, "/_xpack/security/saml/prepare", this);
        controller.registerHandler(POST, "/_xpack/security/user/_has_privileges", this);
        controller.registerHandler(POST, "/_xpack/security/user/_password", this);
        controller.registerHandler(POST, "/_xpack/security/user/{username}", this);
        controller.registerHandler(POST, "/_xpack/security/user/{username}/_disable", this);
        controller.registerHandler(POST, "/_xpack/security/user/{username}/_enable", this);
        controller.registerHandler(POST, "/_xpack/security/user/{username}/_has_privileges", this);
        controller.registerHandler(POST, "/_xpack/security/user/{username}/_password", this);
        controller.registerHandler(POST, "/_xpack/sql", this);
        controller.registerHandler(POST, "/_xpack/sql/close", this);
        controller.registerHandler(POST, "/_xpack/sql/translate", this);
        controller.registerHandler(POST, "/_xpack/watcher/_start", this);
        controller.registerHandler(POST, "/_xpack/watcher/_stop", this);
        controller.registerHandler(POST, "/_xpack/watcher/watch/_execute", this);
        controller.registerHandler(POST, "/_xpack/watcher/watch/{id}", this);
        controller.registerHandler(POST, "/_xpack/watcher/watch/{id}/_ack", this);
        controller.registerHandler(POST, "/_xpack/watcher/watch/{id}/_ack/{actions}", this);
        controller.registerHandler(POST, "/_xpack/watcher/watch/{id}/_activate", this);
        controller.registerHandler(POST, "/_xpack/watcher/watch/{id}/_deactivate", this);
        controller.registerHandler(POST, "/_xpack/watcher/watch/{id}/_execute", this);
        controller.registerHandler(POST, "/{index}/_cache/clear", this);
        controller.registerHandler(POST, "/{index}/_ccr/forget_follower", this);
        controller.registerHandler(POST, "/{index}/_ccr/pause_follow", this);
        controller.registerHandler(POST, "/{index}/_ccr/resume_follow", this);
        controller.registerHandler(POST, "/{index}/_ccr/unfollow", this);
        controller.registerHandler(POST, "/{index}/_clone/{target}", this);
        controller.registerHandler(POST, "/{index}/_close", this);
        controller.registerHandler(POST, "/{index}/_explain/{id}", this);
        controller.registerHandler(POST, "/{index}/_field_caps", this);
        controller.registerHandler(POST, "/{index}/_flush", this);
        controller.registerHandler(POST, "/{index}/_flush/synced", this);
        controller.registerHandler(POST, "/{index}/_forcemerge", this);
        controller.registerHandler(POST, "/{index}/_freeze", this);
        controller.registerHandler(POST, "/{index}/_graph/explore", this);
        controller.registerHandler(POST, "/{index}/_ilm/remove", this);
        controller.registerHandler(POST, "/{index}/_ilm/retry", this);
        controller.registerHandler(POST, "/{index}/_mtermvectors", this);
        controller.registerHandler(POST, "/{index}/_noop_bulk", this);
        controller.registerHandler(POST, "/{index}/_noop_search", this);
        controller.registerHandler(POST, "/{index}/_open", this);
        controller.registerHandler(POST, "/{index}/_rank_eval", this);
        controller.registerHandler(POST, "/{index}/_reload_search_analyzers", this);
        controller.registerHandler(POST, "/{index}/_rollover", this);
        controller.registerHandler(POST, "/{index}/_rollover/{new_index}", this);
        controller.registerHandler(POST, "/{index}/_search_shards", this);
        controller.registerHandler(POST, "/{index}/_shrink/{target}", this);
        controller.registerHandler(POST, "/{index}/_split/{target}", this);
        controller.registerHandler(POST, "/{index}/_termvectors", this);
        controller.registerHandler(POST, "/{index}/_termvectors/{id}", this);
        controller.registerHandler(POST, "/{index}/_unfreeze", this);
        controller.registerHandler(POST, "/{index}/_upgrade", this);
        controller.registerHandler(POST, "/{index}/_validate/query", this);
        controller.registerHandler(POST, "/{index}/_xpack/graph/_explore", this);
        controller.registerHandler(POST, "/{index}/{type}/_graph/explore", this);
        controller.registerHandler(POST, "/{index}/{type}/_mtermvectors", this);
        controller.registerHandler(POST, "/{index}/{type}/_noop_bulk", this);
        controller.registerHandler(POST, "/{index}/{type}/_noop_search", this);
        controller.registerHandler(POST, "/{index}/{type}/_termvector", this);
        controller.registerHandler(POST, "/{index}/{type}/_termvectors", this);
        controller.registerHandler(POST, "/{index}/{type}/_validate/query", this);
        controller.registerHandler(POST, "/{index}/{type}/_xpack/graph/_explore", this);
        controller.registerHandler(POST, "/{index}/{type}/{id}/_explain", this);
        controller.registerHandler(POST, "/{index}/{type}/{id}/_termvector", this);
        controller.registerHandler(POST, "/{index}/{type}/{id}/_termvectors", this);
        controller.registerHandler(POST, "_rollup_search", this);
        controller.registerHandler(POST, "{index}/_rollup_search", this);
        controller.registerHandler(POST, "_xpack/migration/upgrade/{index}", this);
        controller.registerHandler(PUT, "/_ccr/auto_follow/{name}", this);
        controller.registerHandler(PUT, "/_dcdr/auto_replication/{name}", this);
        controller.registerHandler(PUT, "/_dcdr/{index}/replication/create", this);
        controller.registerHandler(PUT, "/_enrich/policy/{name}", this);
        controller.registerHandler(PUT, "/_enrich/policy/{name}/_execute", this);
        controller.registerHandler(PUT, "/_ilm/policy/{name}", this);
        controller.registerHandler(PUT, "/_ingest/pipeline/{id}", this);
        controller.registerHandler(PUT, "/_license", this);
        controller.registerHandler(PUT, "/_noop_bulk", this);
        controller.registerHandler(PUT, "/_monitoring/bulk", this);
        controller.registerHandler(PUT, "/_rollup/job/{id}", this);
        controller.registerHandler(PUT, "/_scripts/{id}", this);
        controller.registerHandler(PUT, "/_scripts/{id}/{context}", this);
        controller.registerHandler(PUT, "/_security/api_key", this);
        controller.registerHandler(PUT, "/_security/privilege/", this);
        controller.registerHandler(PUT, "/_security/role/{name}", this);
        controller.registerHandler(PUT, "/_security/role_mapping/{name}", this);
        controller.registerHandler(PUT, "/_security/user/_password", this);
        controller.registerHandler(PUT, "/_security/user/{username}", this);
        controller.registerHandler(PUT, "/_security/user/{username}/_disable", this);
        controller.registerHandler(PUT, "/_security/user/{username}/_enable", this);
        controller.registerHandler(PUT, "/_security/user/{username}/_password", this);
        controller.registerHandler(PUT, "/_settings", this);
        controller.registerHandler(PUT, "/_slm/policy/{name}", this);
        controller.registerHandler(PUT, "/_slm/policy/{name}/_execute", this);
        controller.registerHandler(PUT, "/_snapshot/{repository}", this);
        controller.registerHandler(PUT, "/_snapshot/{repository}/{snapshot}", this);
        controller.registerHandler(PUT, "/_template/{index}", this);
        controller.registerHandler(PUT, "/_transform/{id}/", this);
        controller.registerHandler(PUT, "/_watcher/watch/_execute", this);
        controller.registerHandler(PUT, "/_watcher/watch/{id}", this);
        controller.registerHandler(PUT, "/_watcher/watch/{id}/_ack", this);
        controller.registerHandler(PUT, "/_watcher/watch/{id}/_ack/{actions}", this);
        controller.registerHandler(PUT, "/_watcher/watch/{id}/_activate", this);
        controller.registerHandler(PUT, "/_watcher/watch/{id}/_deactivate", this);
        controller.registerHandler(PUT, "/_watcher/watch/{id}/_execute", this);
        controller.registerHandler(PUT, "/_xpack/license", this);
        controller.registerHandler(PUT, "/_xpack/monitoring/_bulk", this);
        controller.registerHandler(PUT, "/_xpack/rollup/job/{id}", this);
        controller.registerHandler(PUT, "/_xpack/security/privilege/", this);
        controller.registerHandler(PUT, "/_xpack/security/role/{name}", this);
        controller.registerHandler(PUT, "/_xpack/security/role_mapping/{name}", this);
        controller.registerHandler(PUT, "/_xpack/security/user/_password", this);
        controller.registerHandler(PUT, "/_xpack/security/user/{username}", this);
        controller.registerHandler(PUT, "/_xpack/security/user/{username}/_disable", this);
        controller.registerHandler(PUT, "/_xpack/security/user/{username}/_enable", this);
        controller.registerHandler(PUT, "/_xpack/security/user/{username}/_password", this);
        controller.registerHandler(PUT, "/_xpack/watcher/watch/_execute", this);
        controller.registerHandler(PUT, "/_xpack/watcher/watch/{id}", this);
        controller.registerHandler(PUT, "/_xpack/watcher/watch/{id}/_ack", this);
        controller.registerHandler(PUT, "/_xpack/watcher/watch/{id}/_ack/{actions}", this);
        controller.registerHandler(PUT, "/_xpack/watcher/watch/{id}/_activate", this);
        controller.registerHandler(PUT, "/_xpack/watcher/watch/{id}/_deactivate", this);
        controller.registerHandler(PUT, "/_xpack/watcher/watch/{id}/_execute", this);
        controller.registerHandler(PUT, "/{index}/_ccr/follow", this);
        controller.registerHandler(PUT, "/{index}/_clone/{target}", this);
        controller.registerHandler(PUT, "/{index}/_noop_bulk", this);
        controller.registerHandler(PUT, "/{index}/_shrink/{target}", this);
        controller.registerHandler(PUT, "/{index}/_split/{target}", this);
        controller.registerHandler(PUT, "/{index}/{type}/_noop_bulk", this);

        controller.registerHandler(GET, "/_analyze", this);
        controller.registerHandler(POST, "/_analyze", this);

        controller.registerHandler(GET, "/_settings", this);
        controller.registerHandler(GET, "/_settings/{name}", this);

        controller.registerHandler(POST, "/_mapping/check", this);
        controller.registerHandler(PUT, "/_mapping/check", this);

        controller.registerHandler(GET, "/_alias", this);
        controller.registerHandler(GET, "/_alias/{name}", this);
        controller.registerHandler(GET, "/_aliases", this);

        controller.registerHandler(PUT, "/_alias", this);
        controller.registerHandler(PUT, "/_alias/{name}", this);
        controller.registerHandler(PUT, "/_aliases/{name}", this);
        controller.registerHandler(POST, "/_alias/{name}", this);
        controller.registerHandler(POST, "/_aliases", this);
        controller.registerHandler(POST, "/_aliases/{name}", this);
        controller.registerHandler(HEAD, "/_alias/{name}", this);

        controller.registerHandler(PUT, "/_mapping/{type}", this);
        controller.registerHandler(PUT, "/_mappings/{type}", this);
        controller.registerHandler(POST, "/_mapping/{type}", this);
        controller.registerHandler(POST, "/_mappings/{type}", this);

        controller.registerHandler(GET, "/_refresh", this);
        controller.registerHandler(POST, "/_refresh", this);
        
        controller.registerHandler(GET, "/_resolve/index/{name}", this);

//        controller.registerHandler(POST, "/{index}/_analyze", this);
//        controller.registerHandler(GET, "/{index}/_analyze", this);
//
//        controller.registerHandler(GET, "/{index}/_setting/{name}", this);
//        controller.registerHandler(GET, "/{index}/_settings", this);
//        controller.registerHandler(GET, "/{index}/_settings/{name}", this);
//
//        controller.registerHandler(POST, "/{index}/{type}/_mapping/check", this);
//        controller.registerHandler(PUT, "/{index}/{type}/_mapping/check", this);
//        controller.registerHandler(DELETE, "/{index}/_alias/{name}", this);
//        controller.registerHandler(DELETE, "/{index}/_aliases/{name}", this);
//        controller.registerHandler(POST, "/{index}/_alias/{name}", this);
//        controller.registerHandler(POST, "/{index}/_aliases/{name}", this);
//        controller.registerHandler(PUT, "/{index}/_alias", this);
//        controller.registerHandler(PUT, "/{index}/_alias/{name}", this);
//        controller.registerHandler(PUT, "/{index}/_aliases", this);
//        controller.registerHandler(PUT, "/{index}/_aliases/{name}", this);
//
//        controller.registerHandler(HEAD, "/{index}/_alias", this);
//        controller.registerHandler(HEAD, "/{index}/_alias/{name}", this);
//        controller.registerHandler(GET, "/{index}/_alias", this);
//        controller.registerHandler(GET, "/{index}/_alias/{name}", this);
//
//        controller.registerHandler(PUT, "/{index}/_mapping/", this);
//        controller.registerHandler(PUT, "/{index}/_mapping/{type}", this);
//        controller.registerHandler(PUT, "/{index}/_mappings/", this);
//        controller.registerHandler(PUT, "/{index}/_mappings/{type}", this);
//        controller.registerHandler(PUT, "/{index}/{type}/_mapping", this);
//        controller.registerHandler(PUT, "/{index}/{type}/_mappings", this);
//        controller.registerHandler(POST, "/{index}/{type}/_mapping", this);
//        controller.registerHandler(POST, "/{index}/{type}/_mappings", this);
//        controller.registerHandler(POST, "/{index}/_mapping/", this);
//        controller.registerHandler(POST, "/{index}/_mapping/{type}", this);
//        controller.registerHandler(POST, "/{index}/_mappings/", this);
//        controller.registerHandler(POST, "/{index}/_mappings/{type}", this);
//        controller.registerHandler(HEAD, "/{index}/_mapping/{type}", this);
//
//        controller.registerHandler(GET, "/{index}/_refresh", this);
//        controller.registerHandler(POST, "/{index}/_refresh", this);
//
//        controller.registerHandler(POST, "/{index}/_delete_by_query", this);
//        controller.registerHandler(POST, "/{index}/{type}/_delete_by_query", this);
//
//        controller.registerHandler(POST, "/{index}/_update_by_query", this);
//        controller.registerHandler(POST, "/{index}/{type}/_update_by_query", this);
    }

    @Override
    public String name() {
        return restCommonAction.name();
    }

    @Override
    protected void handleRequest(QueryContext queryContext) throws Exception {
        restCommonAction.handleRequest(queryContext);
    }
}
